

dc = 0.001;
c = [log(2) + dc:dc:1];

x = load('tableData.dat');

Hnumerical = x(:,2) ./ 2;

o = optimset('MaxFunEvals',4000,'MaxIter',4000,'Display','off');


min = 100000000000;
bestc = 0;
for i = 1:numel(c)
     fun = @(x, xdata) fitFunctionForHVariable(x,xdata,c(i));
     N = [2:65]';
     x1 = lsqcurvefit(fun,[0,0,0,0,0,0],N,Hnumerical(1:64),[],[],o);
     N = [2:65,70:5:200]';
     x2 = lsqcurvefit(fun,[0,0,0,0,0,0],N,Hnumerical,[],[],o);
     s = sum((x1-x2).^2);
     if s < min
         bestc = c(i);
         min = s;
     end
end

bestc